<script>
  var getUserPhoto = document.getElementById("input_img");
  getUserPhoto.onchange = function () {
    var file = this.files;
    console.log(file);
    var reader = new FileReader();
    reader.readAsDataURL(file[0]);
    reader.onload = function () {
      var image = document.createElement("img");
      image.width = "400";
      image.src = reader.result;
      var showPicture = document.getElementById("show_img");
      showPicture.append(image);
    };
  };
</script>
......
<input type="file" name="" id="input_img" />
<div id="show_img"></div>
<script>
  var getUserPhoto = document.getElementById("input_img");
  getUserPhoto.onchange = function ()
  {
    var file = this.files;
    console.log(file);
    var reader = new FileReader();
    reader.readAsDataURL(file[0]);
    reader.onload = function ()
    {
      var image = document.getElementById("show_img");
      image.src = reader.result;
    };
  };
</script>
......
